<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()
			+request.getContextPath()+"/";
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<base href="<%=basePath%>">
<title>用户信息管理</title>
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
		<div class="row">
			<div class="col-md-12">
			<form:form action="change" method="post" commandName="hostel">
			<form:hidden path="id" />
			<form:hidden path="student.id"/>
			<form:hidden path="dorm.id"/>
				<table>
					<tr>
						<td>姓名：</td>
						<td>${hostel.student.name }</td>
					</tr>
					<tr>
						<td>性别：</td>
						<td>${hostel.student.gender }</td>
					</tr>
					<tr>
						<td>所属学院：</td>
						<td>${hostel.student.college }</td>
					</tr>
					<tr>
						<td>当前宿舍：</td>
						<td>${hostel.dorm.dname}</td>
					</tr>
					<tr>
						<td>更换宿舍：</td>
						<td>
						<select name="targetDormId">
							<c:forEach items="${dorms }" var="dorm" >
								<option value="${dorm.id }">${dorm.dname }</option>
							</c:forEach>
						</select>
						</td>
					</tr>
					<tr>
						<td colspan="2"><input type="submit" value="更换" /></td>
					</tr>
				</table>
			</form:form>

 		</div>
	</div>
</div>
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
</body>
</html>